package com.learning.servlet3x.annotation;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 * ClassName: CustomListener
 * Description: Servlet3x新特性：使用注解取代标签配置
 * Date: 2014/12/06 16:37 【需求编号】
 *
 * @author Sam Sho
 * @version V1.0.0
 */
@WebListener(value = "Servlet3x 注解实现的监听器 Listener")
public class CustomListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("Servlet3x 注解实现的监听器 Listener: ServletContext 启动监听");
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {

    }
}


/*
相当于web.xml配置:
<listener>
    <listener-class>com.learning.servlet3x.annotation.CustomListener</listener-class>
    <description>Servlet3x 注解实现的监听器 Listener</description>
</listener>
*/
